package com.deer.wms.system.manage.dao;

import com.deer.wms.project.root.mapper.SuperMapper;
import com.deer.wms.system.manage.model.organization.Organization;
import com.deer.wms.system.manage.model.organization.OrganizationCriteria;
import com.deer.wms.system.manage.model.organization.OrganizationDto;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @author guo
 */
public interface OrganizationMapper extends SuperMapper<Organization> {

    /**
     * 按照criteria条件查询
     * @param criteria criteria
     * @return List<OrganizationDto>
     */
    List<OrganizationDto> findList(OrganizationCriteria criteria);

    /**
     * 按照货主编码查询
     * @param organizationCode 货主编码
     * @return List<OrganizationDto>
     */
    List<OrganizationDto> findByOrganizationCode(@Param("organizationCode")String organizationCode);

    /**
     * 按照货主名称查询
     * @param organizationName 货主名称
     * @return List<OrganizationDto>
     */
    List<OrganizationDto> findByOrganizationName(@Param("organizationName")String organizationName);

    /**
     * 批次策略编码
     * @param batchTacticCode 批次策略编码
     * @return List<Organization>
     */
    List<Organization> findByBatchTacticCode(@Param("batchTacticCode")String batchTacticCode);

    /**
     * 按照条件删除
     * @param criteria criteria
     */
    void deleteByCodeAndCom(OrganizationCriteria criteria);

}